# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


# NOTE: This class is auto generated by the swagger code generator program.
# https://github.com/swagger-api/swagger-codegen.git
# Do not edit the class manually.

defmodule GoogleApi.QPXExpress.V1.Model.Data do
  @moduledoc """
  Detailed information about components found in the solutions of this response, including a trip&#39;s airport, city, taxes, airline, and aircraft.

  ## Attributes

  - aircraft (List[AircraftData]): The aircraft that is flying between an origin and destination. Defaults to: `null`.
  - airport (List[AirportData]): The airport of an origin or destination. Defaults to: `null`.
  - carrier (List[CarrierData]): The airline carrier of the aircraft flying between an origin and destination. Allowed values are IATA carrier codes. Defaults to: `null`.
  - city (List[CityData]): The city that is either the origin or destination of part of a trip. Defaults to: `null`.
  - kind (String): Identifies this as QPX Express response resource, including a trip&#39;s airport, city, taxes, airline, and aircraft. Value: the fixed string qpxexpress#data. Defaults to: `null`.
  - tax (List[TaxData]): The taxes due for flying between an origin and a destination. Defaults to: `null`.
  """

  defstruct [
    :"aircraft",
    :"airport",
    :"carrier",
    :"city",
    :"kind",
    :"tax"
  ]
end

defimpl Poison.Decoder, for: GoogleApi.QPXExpress.V1.Model.Data do
  import GoogleApi.QPXExpress.V1.Deserializer
  def decode(value, options) do
    value
    |> deserialize(:"aircraft", :list, GoogleApi.QPXExpress.V1.Model.AircraftData, options)
    |> deserialize(:"airport", :list, GoogleApi.QPXExpress.V1.Model.AirportData, options)
    |> deserialize(:"carrier", :list, GoogleApi.QPXExpress.V1.Model.CarrierData, options)
    |> deserialize(:"city", :list, GoogleApi.QPXExpress.V1.Model.CityData, options)
    |> deserialize(:"tax", :list, GoogleApi.QPXExpress.V1.Model.TaxData, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.QPXExpress.V1.Model.Data do
  def encode(value, options) do
    GoogleApi.QPXExpress.V1.Deserializer.serialize_non_nil(value, options)
  end
end

